package com.lenovo.gpsautotest;

import android.location.GpsSatellite;

import java.util.Iterator;

/**
 * @ProjectName: GpsAutoTest
 * @Package: com.lenovo.gpsautotest
 * @ClassName: LocationResult
 * @Description: LocationResult类作用描述
 * @Author: kgzhou
 * @CreateDate: 2019/5/30 11:16
 * @UpdateUser: kgzhou
 * @UpdateDate: 2019/5/30 11:16
 * @UpdateRemark: 更新说明：
 * @Version: 1.0
 */
public class LocationResult {
    private String result="";
    private Double longitude = -1.0;
    private Double latitude = -1.0;
    //海拔
    private Double altitude=-1.0;
    //方向
    private Float bearing=-1.0f;
    //速度
    private Float speed=-1.0f;
    //卫星迭代器
    private Iterator<GpsSatellite> gpsSatelliteIterator=null;
    //能搜索到的卫星最大值
    private int maxSatellites=-1;
    //时间
    private String time="";
    //次数
    private int order=-1;
    //失败次数
    private int failOrder=-1;
    //距离
    private double distance;
    //Time To First Fix
    private int timeToFirstFix=-1;
    //Used Time定位花费时间
    private long usedTime = -1;


    public Double getLongitude() {
        return longitude;
    }

    public void setLongitude(Double longitude) {
        this.longitude = longitude;
    }

    public Double getLatitude() {
        return latitude;
    }

    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }

    public Double getAltitude() {
        return altitude;
    }

    public void setAltitude(Double altitude) {
        this.altitude = altitude;
    }

    public Float getBearing() {
        return bearing;
    }

    public void setBearing(Float bearing) {
        this.bearing = bearing;
    }

    public Float getSpeed() {
        return speed;
    }

    public void setSpeed(Float speed) {
        this.speed = speed;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public Iterator<GpsSatellite> getGpsSatelliteIterator() {
        return gpsSatelliteIterator;
    }

    public void setGpsSatelliteIterator(Iterator<GpsSatellite> gpsSatelliteIterator) {
        this.gpsSatelliteIterator = gpsSatelliteIterator;
    }

    public int getMaxSatellites() {
        return maxSatellites;
    }

    public void setMaxSatellites(int maxSatellites) {
        this.maxSatellites = maxSatellites;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public double getDistance() {
        return distance;
    }

    public void setDistance(double distance) {
        this.distance = distance;
    }

    public int getFailOrder() {
        return failOrder;
    }

    public void setFailOrder(int failOrder) {
        this.failOrder = failOrder;
    }

    public int getTimeToFirstFix() {
        return timeToFirstFix;
    }

    public void setTimeToFirstFix(int timeToFirstFix) {
        this.timeToFirstFix = timeToFirstFix;
    }

    public long getUsedTime() {
        return usedTime;
    }

    public void setUsedTime(long usedTime) {
        this.usedTime = usedTime;
    }

    @Override
    public String toString() {
        StringBuilder builder=new StringBuilder();
        builder.append("第"+getOrder()+"次: 重试第"+getFailOrder()+"次 "+"\n");
        builder.append("定位成功/失败："+getResult()+"\n");
        builder.append("经    度    : " + getLongitude() + "\n");
        builder.append("纬    度    : " + getLatitude() + "\n");
        builder.append("高    度    : " + getAltitude() + "\n");
        builder.append("距    离   : " + getDistance() + "\n");
        builder.append("方    向    : " + getBearing() + "\n");
        builder.append("速    度    : " + getSpeed() + "\n");
        builder.append("卫星最大值   : " + getMaxSatellites() + "\n");
        builder.append("时    间   : " + getTime() + "\n");
        builder.append("Time To First Fix : " + getTimeToFirstFix() + "\n");
        builder.append("Used Time : " + getUsedTime() + "ms\n");
        return builder.toString();
    }
}
